import { post, postWithLoadTip, get, form, exportpost } from '@/utils/request';

// export function employeePage(data: any): any {
//     return post(`/api/userExtend/selectPageList`, data);
// }
export function employeePage(data: any): any {
  return post(`/api/user/v1/employee/page`, data);
}

export function employeeEdit(data: any): any {
  if (data.user.id === null) {
    return postWithLoadTip(`/api/user/v1/employee/create`, data);
  } else {
    return postWithLoadTip(`/api/user/v1/employee/update`, data);
  }
}

export function employeeSelect(id: any): any {
  return post(`/api/user/v1/employee/select/${id}`, undefined);
}

export function employeeDelete(id: any): any {
  return postWithLoadTip(`/api/user/v1/employee/delete/${id}`, undefined);
}

export function employeeExport(data: any): any {
  return postWithLoadTip(`/api/user/v1/employee/export`, data);
}

export function adminPage(data: any): any {
  return post(`/api/user/admin/page`, data);
}

export function adminEdit(data: any): any {
  if (data.id === null) {
    return postWithLoadTip(`/api/user/admin/create`, data);
  } else {
    return postWithLoadTip(`/api/user/admin/update`, data);
  }
}

export function adminSelect(id: any): any {
  return post(`/api/user/admin/select/${id}`, undefined);
}

export function adminDelete(id: any): any {
  return postWithLoadTip(`/api/user/admin/delete/${id}`, undefined);
}

export function userByUserName(data: any): any {
  return post(`/api/user/selectByUserName`, data);
}
// Page(data: any): any {
//   return post(`/api/userExtendTrain/pageTrain`, data);
// }
// 人员违规 培训列表  列表
export function userExtendTrainPage(data: any): any {
  return post(`api/userExtendTrain/pageTrain`, data);
}
// 人员违规 培训列表  新增
export function userExtendTrainInsert(data: any): any {
  return post(`/api/userExtendTrain/insert`, data);
}
// 人员违规 培训列表  删除
export function userExtendTrainDelete(data: any): any {
  return form(`/api/userExtendTrain/deleteById`, data);
}
// 人员违规 培训列表  修改
export function userExtendTrainUpdate(data: any): any {
  return post(`/api/userExtendTrain/update`, data);
}
// 人员违规 培训列表  详情
export function userExtendTrainDetail(data: any): any {
  return get(`/api/userExtendTrain/selectOne/` + data, '');
}

// 人员违规
export function userExtendViolationPage(data: any): any {
  return post(`/api/userExtendViolation/pageViolation`, data);
}

// 人员违规  新增
export function userExtendViolationInsert(data: any): any {
  return post(`/api/userExtendViolation/insert`, data);
}

// 人员违规  删除
export function userExtendViolationDelete(data: any): any {
  return form(`/api/userExtendViolation/deleteById`, data);
}

// 人员违规  修改
export function userExtendViolationUpdate(data: any): any {
  return post(`/api/userExtendViolation/update`, data);
}

// 人员违规  详情
export function userExtendViolationDetail(data: any): any {
  return post(`/api/userExtendViolation/pageViolation`, data);
}

//安全教育培训
export function extenInsert(data: any): any {
  return post(`/api/userExtendTrain/insert`, data);
}
export function extenUpdate(data: any): any {
  return post(`/api/userExtendTrain/update`, data);
}
export function extenDelete(id: any): any {
  return post(`/api/userExtendTrain/deleteById/${id}`, undefined);
}
export function extenList(data: any): any {
  return post(`/api/userExtendTrain/pageTrain`, data);
}
// 违章记录
export function violationInsert(data: any): any {
  return post(`/api/userExtendViolation/insert`, data);
}
export function violationUpdate(data: any): any {
  return post(`/api/userExtendViolation/update`, data);
}
export function violationDelete(id: any): any {
  return post(`/api/userExtendViolation/deleteById/${id}`, undefined);
}
export function violationList(data: any): any {
  return post(`/api/userExtendViolation/pageViolation`, data);
}
export function addUserFileApi(data: any): any {
  return post(`/api/userFile/add`, data);
}
export function getUserFileListApi(data: any): any {
  if (data.userId !== null) {
    return post(`/api/userFile/list`, data);
  }
}
export function deleteUserFileApi(data: any): any {
  return post(`/api/userFile/delete`, data);
}
export function deleteUser(ids: any): any {
  return post(`/api/user/v1/employee/batchDelete`, ids);
}

// 查询字典数据的详细信息
export function getDictDataType(type: any): any {
  return get(`/api/dict/data/type/${type}`, undefined);
}
//积分列表
export function userpointPage(data: any): any {
  return post(`/api/userPoint/page`, data);
}
//积分列表导出
export function userpointExport(data: any): any {
  return exportpost(`/api/userPoint/point/export`, data);
}
export function userpointimport(data: any): any {
  return exportpost(`/api/userPoint/point/import`, data);
}
//修改积分
export function updatePoint(data: any): any {
  return post(`/api/userPoint/updatePoint`, data);
}

//奖惩
export function userRpPage(data: any): any {
  return post(`/api/userExtendSkill/pageSkill`, data);
}

// 奖惩  新增
export function userRpInsert(data: any): any {
  return post(`/api/userExtendSkill/insert`, data);
}

// 奖惩  删除
export function userRpDelete(data: any): any {
  return form(`/api/userExtendSkill/deleteById`, data);
}

// 奖惩  修改
export function userRpUpdate(data: any): any {
  return post(`/api/userExtendSkill/update`, data);
}

export function userexperiencePage(data: any): any {
  return post(`/api/userExtendWork/pageWork`, data);
}

// 经历  新增
export function userexperienceInsert(data: any): any {
  return post(`/api/userExtendWork/insert`, data);
}

// 经历  删除
export function userexperienceDelete(data: any): any {
  return form(`/api/userExtendWork/deleteById`, data);
}

// 经历  修改
export function userexperienceUpdate(data: any): any {
  return post(`/api/userExtendWork/update`, data);
}

//白名单
export function wlPage(data: any): any {
  return post(`/api/userWhite/page`, data);
}

export function wlInsert(data: any): any {
  return post(`/api/userWhite/insert`, data);
}
export function wlChangeStatus(data: any): any {
  return post(`/api/userWhite/changeStatus`, data);
}
export function wlDelete(id: any): any {
  return post(`/api/userWhite/delete/${id}`, undefined);
}

//重置密码
export function resetPassword(ids: any): any {
  return post(`/api/user/v1/employee/resetPwd`, ids);
}
